import { request } from '@umijs/max';

// 拉取文章
export async function getArticles(params: any) {
  return request<API.ReqResult>(`/api/article/articles`, {
    method: 'GET',
    params,
  });
}

// 文章编辑
export async function article_article(body: any) {
  return request<API.ReqResult>(`/api/article/articles`, {
    method: 'PUT',
    data: body,
  });
}

// 文章审核通过
export async function article_check(body: any) {
  return request<API.ReqResult>(`/api/article/articles`, {
    method: 'POST',
    data: body,
  });
}

// 文章正则替换
export async function article_change(body: any) {
  return request<API.ReqResult>(`/api/article/reg`, {
    method: 'POST',
    data: body,
  });
}

// 文章正则替换
export async function del_articles(body: any) {
  return request<API.ReqResult>(`/api/article/articles`, {
    method: 'DELETE',
    data: body,
  });
}
